package com.akl.ssmspringboot.entity;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.Data;

import java.io.Serializable;

/**
 * @ClassName:
 * @Author: Guoxy
 * @Date: Created in 16:21 2018/11/30
 * @Version:1.0
 */
@Data
@TableName(value = "login")
public class Login extends Model<Login> {

    /**
     * 登陆id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 登陆名
     */
    @TableField(value = "login_name")
    private String loginName;
    /**
     * 密码
     */
    @TableField(value = "password")
    private String password;
    /**
     * 角色id
     */
    @TableField(value = "role_id")
    private Integer roleId;
    /**
     * 角色
     */
    @TableField(value = "role_name")
    private String roleName;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "Login{" +
                "id=" + id +
                ", loginName='" + loginName + '\'' +
                ", password='" + password + '\'' +
                ", roleId=" + roleId +
                ", roleName='" + roleName + '\'' +
                '}';
    }
}
